The Forms mode control file serves two purposes. First, it names the data file to use, and defines its format and properties. Second, the Emacs buffer it occupies is used by Forms mode to display the forms.
The contents of the control file are evaluated as a Lisp program. It should set the following Lisp variables to suitable values:
forms-file
(setq forms-file "my/data-file")
If the control file doesn't set forms-file,
Forms mode reports an error.
forms-format-listforms-number-of-fields
(setq forms-number-of-fields 10)
If the control file does not set
forms-format-list a default format is used. In this
situation, Forms mode will deduce the number of fields from the
data file providing this file exists and
forms-number-of-records has not been set in the
control file.
The control file can optionally set the following additional Forms mode variables. Most of them have default values that are good for most applications.
forms-field-sep"\t" (a Tab
character). Example:
(setq forms-field-sep "\t")
forms-read-onlynil, the data file is
treated read-only. (Forms mode also treats the data file as
read-only if you don't have access to write it.) Example:
(set forms-read-only t)
forms-multi-linenil, multi-line text fields are prohibited.
The pseudo newline must not be a character contained in
forms-field-sep.
The default value is "\^k", the character
Control-K. Example:
(setq forms-multi-line "\^k")
forms-read-file-filternil, no function is
called. For example, to maintain a gzipped database:
(defun gzip-read-file-filter ()
(shell-command-on-region (point-min) (point-max)
"gzip -d" t t))
(setq forms-read-file-filter 'gzip-read-file-filter)
forms-write-file-filterforms-read-file-filter. If it is
nil, no function is called. Example:
(defun gzip-write-file-filter ()
(make-variable-buffer-local 'require-final-newline)
(setq require-final-newline nil)
(shell-command-on-region (point-min) (point-max)
"gzip" t t))
(setq forms-write-file-filter 'gzip-write-file-filter)
forms-new-record-filternil, no function is called. See Modifying
Forms Contents, for details.
forms-modified-record-filternil, no function is called. See Modifying
Forms Contents, for details.
forms-insert-afternil, new records are
created after the current record. Also, upon
visiting a file, the initial position will be at the last
record instead of the first one.
forms-check-number-of-fieldsnil, these
checks will be bypassed.